Language Overview
The
simpliest macro is just a text like "Hello World!".
When "played back",
keystrokes to produce given text are sent so that the text is "typed" to
the target application (usually application that is active - i.e., receiving
keyboard focus). Such simple macros are used to quicklly
insert often used pieces of text (phrases, e-mail addresses, paragraphs,
etc.) to different applications and documents. However, macros can also contain
some commands. If there is a command within the macro then it is
automatically recognized and executed.
Commands have its
special syntax that makes it easier to recognize them within the whole macro
text. The command usually looks like this:
<some_command>("param1", param2, ...)
Parameter can be:
- Static text (constant)
- Variable
- Combination of a static text and variables. Variable
used in a combination with static text must be enclosed in % chars (ôa text %vVariable%
text continuesà). For example, to create a file with name based on the
current date you can use this: <filecreate>(ôc:\myfiles\%_vCurrDate_Year%-%_vCurrDate_MM%-%_vCurrDate_DD%.docö,0).
This will create c:\myfiles\2000-08-19.doc file.
- Expression - expression has this syntax:
EXPR(expression) or EXPRXX(expression) where XX specifies how many digits
follow after decimal point (real numbers). Example: <mm>(EXPR(%_vScreenWidth%/2),
EXPR(%_vScreenHeight%/2))
There are also commands
that have no parameters. Such commands look like this:
<command_noparam>
Each command can be
visually edited so that it is not
necessary to know the command syntax - just put cursor on the command and
use "Edit command" button. There are 150+ commands designed to accomplish
variety Windows automation tasks.
Special keys
(like 'Enter', 'Page Down', etc.) use the same syntax as commands with no
parameters:
<enter>
<pgdn>
Variables
There is also a support for
variables
implemented. There are three basic types of variables:
- Macro
local
variables - user defines these variables using <varset> command. The
variable name can be any string and the variable is known only inside the
macro it is defined.
- Global variables - there are two types of global variables that differ by
scope:
- macro global variable - the variable is known in all the macros
(called from each other using <run> command) during the macro execution. The
macro global variable must begin with the
"gm_" prefix (for example, "gm_varName").
- application global variable - the variable is known during the
whole application session (the value is remembered until the program is
closed). The application global variable must begin with the
"ga_" prefix (for example, "ga_varCurrentProject").
-
System variables - the variables provide system dependent information.
Cannot be changed by <varchng> command (are "read-only").
-
Parameters - if a procedure
parameter starts with "par" prefix (for example, "parInputText") then the
parameter is local only within the procedure. Otherwise the parameter is
either macro local or global as described above.
- Local
procedure variables - if a variable defined within
a procedure starts with "lpv" (local
procedure variable) prefix (for example, "lpvTemporaryVariable")
then the variable is known and can be accessed only within the procedure.
All the variables (except
system variables) can be used also as an array without any special declaration.
For the array, this syntax is used:
varVariableName[index]
If a variable with the given index (for example, varName[10]) doesn't have a
value assigned yet the default value is empty string (note: Empty string is
defined also as a system variable _vStrErmpty).